﻿using System;
using System.Collections.Generic;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using JESAI.Core.Modularity;

namespace JESAI.Core.Builders
{
    /// <summary>
    /// JESAI 构建器
    /// </summary>
    public interface IJESAIBuilder
    {
        /// <summary>
        /// 服务集合
        /// </summary>
        IServiceCollection Services { get; }

        /// <summary>
        /// 加载的模块集合
        /// </summary>
        IEnumerable<JESAIModule> Modules { get; }

        /// <summary>
        /// 添加指定模块
        /// </summary>
        /// <typeparam name="TModule">要添加的模块类型</typeparam>
        IJESAIBuilder AddModule<TModule>() where TModule : JESAIModule;

        /// <summary>
        /// 添加加载的所有模块，并可排除指定的模块类型
        /// </summary>
        /// <param name="exceptModuleTypes">要排除的模块类型</param>
        IJESAIBuilder AddModules(params Type[] exceptModuleTypes);

        IConfiguration Configuration { get; }
    }
}
